# Maintainer: Baptiste Jonglez <baptiste--aur at jonglez dot org>
# Contributor: Matej Grabovsky <matej.grabovsky at gmail>
# Contributor: Kohei Suzuki <eagletmt@gmail.com>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: Nathan Owe <ndowens.aur at gmail dot com>
# Contributor: George Giorgidze <giorgidze@gmail.com>
# Contributor: Massimiliano Brocchini <brocchini@netseven.it>
# Contributor: Tej Chajed <tchajed at mit dot edu>

pkgname=camlp5
pkgver=8.0
_relname=rel8.00.03
pkgrel=4
arch=('loong64' 'x86_64')
pkgdesc='A preprocessor-pretty-printer of OCaml.'
url='https://camlp5.github.io/'
license=('BSD')
depends=('ocaml>=4.14.0' 'camlp-streams')
makedepends=('ocaml-compiler-libs>=4.14.0' 'ocaml-findlib')
source=("camlp5-${_relname}.tar.gz::https://github.com/camlp5/camlp5/archive/$_relname.tar.gz")
sha256sums=('1a710e2a6dbb0f4440867850d605f31fe8407ee8a56c9e067866e34e584385b4')
options=('!strip' 'staticlibs')

build() {
  cd "${srcdir}/camlp5-${_relname}"

  ./configure \
    -prefix '/usr' \
    -mandir '/usr/share/man' \
    -strict

  make world.opt
}

package() {
  cd "${srcdir}/camlp5-${_relname}"

  make DESTDIR="${pkgdir}" install

  install -D -m644 etc/META "${pkgdir}/usr/lib/ocaml/camlp5"
  install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/camlp5/LICENSE"
}

